class Watcher {
    constructor(vm,expr,cb){
        this.vm = vm;//obj 观察的对象
        this.expr = expr;//"counter1" 观察的属性
        this.cb = cb;//值更新之后回调函数
    }
    update() {
        this.cb();
    }
}
let originalTextContent = 'counter1:{{counter1}},counter2:{{counter2}}';
let match=null;
let reg = /\{\{(.+?)\}\}/g;
let vm = {counter1:0}
const updateTextContent = ()=>console.log('updateTextContent')
while((match = reg.exec(originalTextContent))!==null){
    console.log(match)
    const key = match[1].trim();//counter2
    new Watcher(vm,key,updateTextContent);
}
